{include file="public/head" /}
{include file="public/js_ueditor" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('g_system')}{:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('g_system')}{:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>存储设置</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card card-outline card-success card-outline-tabs border-top-0">
                            <div class="card-header p-0">
                                <div class="float-left nav-link"><i class="fa fa-cloud-upload-alt mr-1"></i>存储设置</div>
                                <ul class="nav nav-tabs border-bottom-0 float-right">
                                    <li class="nav-item">
                                        <a class="nav-link active" data-toggle="pill" href="#tab_general">{:lang('v_basic')}</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" data-toggle="pill" href="#tab_qiniu">七牛云</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" data-toggle="pill" href="#tab_aliyun">阿里云</a>
                                    </li>
                                    <li class="nav-item">
                                        <a class="nav-link" data-toggle="pill" href="#tab_qcloud">腾讯云</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="card-body">
                                <form name="form_edit" id="form_edit" method="post" action="{:url('/system/storage',['lang'=>$lang])}">
                                    <input type="hidden" name="lang" value="{:input('lang')}">
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="tab_general">
                                            <div class="row mb-3">
                                                <div class="col-md-3 text-right">存储类型</div>
                                                <div class="col-md-9">
                                                    <label class="form-check form-check-inline" onclick="javascript:water('public');">
                                                        <input type="radio" name="type" value="public" {if config('global.storage.type') eq 'public' or empty(config('global.storage.type'))}checked="checked"{/if} class="form-check-input" />
                                                        本地
                                                    </label>
                                                    <label class="form-check form-check-inline" onclick="javascript:water('');">
                                                        <input type="radio" name="type" value="qiniu" {if config('global.storage.type') eq 'qiniu'}checked="checked"{/if} class="form-check-input" />
                                                        七牛云
                                                    </label>
                                                    <label class="form-check form-check-inline" onclick="javascript:water('');">
                                                        <input type="radio" name="type" value="aliyun" {if config('global.storage.type') eq 'aliyun'}checked="checked"{/if} class="form-check-input" />
                                                        阿里云
                                                    </label>
                                                    <label class="form-check form-check-inline" onclick="javascript:water('');">
                                                        <input type="radio" name="type" value="qcloud" {if config('global.storage.type') eq 'qcloud'}checked="checked"{/if} class="form-check-input" />
                                                        腾讯云
                                                    </label>
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 col-form-label text-right">{:lang('v_file_naming_method')}</div>
                                                <div class="col-md-4">
                                                    <select name="upload_filename" class="form-control">
                                                        <option value="uniqid" {if config('global.storage.upload_filename') eq 'uniqid'}selected="selected"{/if}>{:lang('v_unique')} ID【uniqid {:lang('v_function')}】</option>
                                                        <option value="original" {if config('global.storage.upload_filename') eq 'original'}selected="selected"{/if}>{:lang('v_original_name')} + {:lang('v_year_m_d_h_m_s')}</option>
                                                        <option value="date" {if config('global.storage.upload_filename') eq 'date'}selected="selected"{/if}>{:lang('v_year_m_d_h_m_s')} + {:lang('v_four_random')}</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 col-form-label text-right">{:lang('v_img_upload_size_limit')}【KB】</div>
                                                <div class="col-md-4">
                                                    <input type="text" class="form-control" name="imageMaxSize" value="{:config('global.storage.imageMaxSize')}" />
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 col-form-label text-right">{:lang('v_file_upload_size_limit')}【MB】</div>
                                                <div class="col-md-4">
                                                    <input type="text" class="form-control" name="fileMaxSize" value="{:config('global.storage.fileMaxSize')}" />
                                                </div>
                                            </div>
                                            <div id="water_tips" class="{if in_array(config('global.storage.type'),array('public'))}d-none{/if} text-danger">
                                                <div class="row form-group">
                                                    <div class="col-md-3 text-right"></div>
                                                    <div class="col-md-9">
                                                        <i class="fas fa-info-circle mr-1"></i>目前只有本地才支持缩略图和水印
                                                    </div>
                                                </div>
                                            </div>
                                            <div id="water" class="{if in_array(config('global.storage.type'),array('qiniu','aliyun','qcloud'))}d-none{/if}">
                                                <div class="row form-group">
                                                    <div class="col-md-3 text-right">{:lang('v_enable_ornot')} {:lang('v_thumbnail')}</div>
                                                    <div class="col-md-9">
                                                        <label class="form-check form-check-inline">
                                                            <input type="radio" name="thumbnail" value="1" {if config('global.image.thumbnail') eq 1}checked="checked" {/if} class="form-check-input" />{:lang('v_yes')}
                                                        </label>
                                                        <label class="form-check form-check-inline">
                                                            <input type="radio" name="thumbnail" value="0" {if config('global.image.thumbnail') eq 0}checked="checked" {/if} class="form-check-input" />{:lang('v_no')}
                                                        </label>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_thumbnail')} {:lang('v_size')}</div>
                                                    <div class="col-md-4">
                                                        <input type="text" name="thumbwidth" value="{:config('global.image.thumbwidth')}" class="input" /> x <input type="text" name="thumbheight" value="{:config('global.image.thumbheight')}" class="input" /> px
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_thumbnail')} {:lang('v_mode')}</div>
                                                    <div class="col-md-4">
                                                        <table class="table table-bordered table-condensed table-hover">
                                                            <tr>
                                                                <td><label><input type="radio" name="thumb" value="1" {if config('global.image.thumb') eq 1}checked="checked" {/if} class="mr-1" />{:lang('v_proportional_scaling')}</label></td>
                                                                <td><label><input type="radio" name="thumb" value="2" {if config('global.image.thumb') eq 2}checked="checked" {/if} class="mr-1" />{:lang('v_scale_after_filling')}</label></td>
                                                                <td><label><input type="radio" name="thumb" value="3" {if config('global.image.thumb') eq 3}checked="checked" {/if} class="mr-1" />{:lang('v_centering_cutting_type')}</label></td>
                                                            </tr>
                                                            <tr>
                                                                <td><label><input type="radio" name="thumb" value="4" {if config('global.image.thumb') eq 4}checked="checked" {/if} class="mr-1" />{:lang('v_upper_left_corner_cutting')}</label></td>
                                                                <td><label><input type="radio" name="thumb" value="5" {if config('global.image.thumb') eq 5}checked="checked" {/if} class="mr-1" />{:lang('v_lower_right_corner_cutting')}</label></td>
                                                                <td><label><input type="radio" name="thumb" value="6" {if config('global.image.thumb') eq 6}checked="checked" {/if} class="mr-1" />{:lang('v_fixed_size_scaling')}</label></td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 text-right">{:lang('v_watermark')} {:lang('v_type')}</div>
                                                    <div class="col-md-4">
                                                        <label class="form-check form-check-inline">
                                                            <input type="radio" name="water" value="0" {if config('global.image.water') eq 0}checked="checked" {/if} class="form-check-input" />{:lang('v_disable')}
                                                        </label>
                                                        <label class="form-check form-check-inline">
                                                            <input type="radio" name="water" value="1" {if config('global.image.water') eq 1}checked="checked" {/if} class="form-check-input" />{:lang('v_word')} {:lang('v_watermark')}
                                                        </label>
                                                        <label class="form-check form-check-inline">
                                                            <input type="radio" name="water" value="2" {if config('global.image.water') eq 2}checked="checked" {/if} class="form-check-input" />{:lang('v_img')} {:lang('v_watermark')}
                                                        </label>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_watermark')} {:lang('v_position')}</div>
                                                    <div class="col-md-4">
                                                        <table class="table table-bordered table-condensed table-hover">
                                                            <tr>
                                                                <td><label><input type="radio" name="waterPosition" value="1" {if config('global.image.waterPosition') eq 1}checked="checked" {/if} class="mr-1" />{:lang('v_top_left')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="2" {if config('global.image.waterPosition') eq 2}checked="checked" {/if} class="mr-1" />{:lang('v_top_center')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="3" {if config('global.image.waterPosition') eq 3}checked="checked" {/if} class="mr-1" />{:lang('v_top_right')}</label></td>
                                                            </tr>
                                                            <tr>
                                                                <td><label><input type="radio" name="waterPosition" value="4" {if config('global.image.waterPosition') eq 4}checked="checked" {/if} class="mr-1" />{:lang('v_center_left')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="5" {if config('global.image.waterPosition') eq 5}checked="checked" {/if} class="mr-1" />{:lang('v_center_middle')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="6" {if config('global.image.waterPosition') eq 6}checked="checked" {/if} class="mr-1" />{:lang('v_center_right')}</label></td>
                                                            </tr>
                                                            <tr>
                                                                <td><label><input type="radio" name="waterPosition" value="7" {if config('global.image.waterPosition') eq 7}checked="checked" {/if} class="mr-1" />{:lang('v_bottom_left')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="8" {if config('global.image.waterPosition') eq 8}checked="checked" {/if} class="mr-1" />{:lang('v_bottom_center')}</label></td>
                                                                <td><label><input type="radio" name="waterPosition" value="9" {if config('global.image.waterPosition') eq 9}checked="checked" {/if} class="mr-1" />{:lang('v_bottom_right')}</label></td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_watermark')} {:lang('v_img')}</div>
                                                    <div class="col-md-4">
                                                        <div class="input-group">
                                                            <input value="{:config('global.image.waterImage')}" name="waterImage" id="morepics1" type="text" class="form-control">
                                                            <span class="input-group-append">
                                                                <button onclick="upImage('#morepics1');" type="button" class="btn btn-success"><i class="fas fa-cloud-upload-alt mr-1"></i>{:lang('v_upload_img')}</button>
                                                            </span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_watermark')} {:lang('v_transparency')}</div>
                                                    <div class="col-md-4">
                                                        <input type="text" class="form-control" name="transparency" value="{:config('global.image.transparency')}" />
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_watermark')} {:lang('v_word')}</div>
                                                    <div class="col-md-4">
                                                        <input type="text" class="form-control" name="waterText" value="{:config('global.image.waterText')}" />
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_watermark')} {:lang('v_font')}</div>
                                                    <div class="col-md-4">
                                                        <select name="waterfont" class="form-control">
                                                            {foreach $font_list as $fontRs}
                                                                <option value="{$fontRs}" {if config('global.image.waterfont') eq $fontRs}selected="selected"{/if}>{$fontRs}</option>
                                                            {/foreach}
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_word')} {:lang('v_color')}</div>
                                                    <div class="col-md-4">
                                                        <input type="text" class="form-control colorpicker1" name="watercolor" value="{:config('global.image.watercolor')}" style="color:{:config('global.image.watercolor')};">
                                                    </div>
                                                </div>
                                                <div class="row form-group">
                                                    <div class="col-md-3 col-form-label text-right">{:lang('v_word')} {:lang('v_size')}</div>
                                                    <div class="col-md-4">
                                                        <input type="text" class="form-control" name="watersize" value="{:config('global.image.watersize')}" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="w-100 mb-5"></div>
                                        </div>
                                        <div class="tab-pane" id="tab_qiniu">
                                            <div class="row mb-3">
                                                <a class="offset-md-3 col-md-9" href="https://www.qiniu.com/products/kodo" target="_blank">点击开通七牛云（对象存储 Kodo）&gt;&gt;</a>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">七牛云accessKey</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qiniu_access_key" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">七牛云secretKey</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qiniu_secret_key" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">七牛云bucket</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qiniu_bucket" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">七牛云url</div>
                                                <div class="col-md-4">
                                                    <input type="text" name="qiniu_url" value="******" class="form-control">
                                                    如：http://sadfas123.hn-bkt.clouddn.com，不要斜杠结尾
                                                </div>
                                            </div>
                                            <div class="w-100 mb-5"></div>
                                        </div>
                                        <div class="tab-pane" id="tab_aliyun">
                                            <div class="row mb-3">
                                                <a class="offset-md-3 col-md-9" href="https://www.aliyun.com/product/oss" target="_blank">点击开通阿里云（对象存储 OSS）&gt;&gt;</a>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">阿里云accessId</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="aliyun_access_id" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">阿里云accessSecret</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="aliyun_access_secret" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">阿里云bucket</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="aliyun_bucket" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">阿里云endpoint</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="aliyun_endpoint" value="******" class="form-control">
                                                    如：oss-cn-shenzhen.aliyuncs.com
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">阿里云url</div>
                                                <div class="col-md-4">
                                                    <input type="text" name="aliyun_url" value="******" class="form-control">
                                                    如：https://asdfasf.oss-cn-shenzhen.aliyuncs.com，不要斜杠结尾
                                                </div>
                                            </div>
                                            <div class="w-100 mb-5"></div>
                                        </div>
                                        <div class="tab-pane" id="tab_qcloud">
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云region</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_region" value="******" class="form-control">
                                                    bucket 所属区域 英文
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云appId</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_appid" value="******" class="form-control">
                                                    域名中数字部分
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云secretId</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_secretid" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云secretKey</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_secret_key" value="******" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云bucket</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_bucket" value="******" class="form-control">
                                                    如：asdfasf
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云timeout</div>
                                                <div class="col-md-3">
                                                    <input type="number" name="qcloud_timeout" value="{:config('filesystem.disks.qcloud.timeout')}" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云connect_timeout</div>
                                                <div class="col-md-3">
                                                    <input type="number" name="qcloud_connect_timeout" value="{:config('filesystem.disks.qcloud.connect_timeout')}" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云scheme</div>
                                                <div class="col-md-3">
                                                    <input type="text" name="qcloud_scheme" value="{:config('filesystem.disks.qcloud.scheme')}" class="form-control">
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云read_from_cdn</div>
                                                <div class="col-md-3">
                                                    <select name="qcloud_read_from_cdn" class="form-control">
                                                        <option value="false" {if config('filesystem.disks.qcloud.read_from_cdn') eq false}selected="selected"{/if}>false</option>
                                                        <option value="true" {if config('filesystem.disks.qcloud.read_from_cdn') eq true}selected="selected"{/if}>true</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="row mb-3">
                                                <div class="col-md-3 col-form-label text-right">腾讯云cdn</div>
                                                <div class="col-md-4">
                                                    <input type="text" name="qcloud_cdn" value="******" class="form-control">
                                                    如：https://asdfasf-1234123423.cos.ap-guangzhou.myqcloud.com，不要斜杠结尾
                                                </div>
                                            </div>
                                            <div class="w-100 mb-5"></div>
                                        </div>
                                        <div class="row">
                                            <div class="offset-md-3 col-md-9 mb-4">
                                                {if is_file(app()->getRootPath().'.env')}
                                                    <button type="submit" class="btn btn-success mr-4"><i class="fa fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                                {else /}
                                                    <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/system/storage',['lang'=>$lang])}','{:url('/system/storage',['lang'=>$lang])}');"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                                {/if}
                                                <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
<script type="text/javascript">
function water(id){
    if(id == 'public'){
        $('#water').removeClass('d-none');
        $('#water_tips').addClass('d-none');
    }else{
        $('#water').addClass('d-none');
        $('#water_tips').removeClass('d-none');
    }
}
</script>
<script type="text/plain" id="input_editor" style="display:none;"></script>
{include file="public/js_upload_img" /}
</body>
</html>